﻿@using FwProject.PrePaymentInfo.Dto
@model FinanceSummaryOutputDto
@{
    Layout = null;
    int distribution = 0;
    int recovery = 0;
    int exchangegoods = 0;
    int give = 0;
    int backBox = 0;
    int backNumber = 0;
    int damage = 0;
    decimal totalPrice = 0;
}
<div id="table_print">
    <table class="table table-bordered table-hover table-rowselected">
        <thead>
            <tr>
                <th colspan="8"><h3>配送统计</h3></th>
            </tr>
            <tr>
                <th>商品名称</th>
                <th>配送箱数</th>
                <th>回收箱数</th>
                <th>换货箱数</th>
                <th>赠送箱数</th>
                @*<th>退回箱数</th>*@
                <th>退回套数</th>
                <th>折损套数</th>
                <th>应收金额</th>
            </tr>
        </thead>
        <tbody>
            @if (Model.DistributionProductStatistics.Count == 0)
            {
                <tr><td class="text-center" colspan="8">暂无信息</td></tr>
            }
            else
            {
                foreach (var item in Model.DistributionProductStatistics)
                {
                    distribution = distribution + item.DistributionCount;
                    recovery = recovery + item.RecoveryCount;
                    exchangegoods = exchangegoods + item.ExchangegoodsCount;
                    give = give + item.GiveCount;
                    backBox = backBox + item.BackBoxCount;
                    backNumber = backNumber + item.BackNumberCount;
                    damage = damage + item.DamageCount;
                    totalPrice += item.TotalPrice;
                    <tr>
                        <td>@item.ProductName</td>
                        <td>@item.DistributionCount</td>
                        <td>@item.RecoveryCount</td>
                        <td>@item.ExchangegoodsCount</td>
                        <td>@item.GiveCount</td>
                        @*<td>@item.BackBoxCount</td>*@
                        <td>@item.BackNumberCount</td>
                        <td>@item.DamageCount</td>
                        <td>@item.TotalPrice</td>
                    </tr>
                }
                    <tr class="footer">
                        <td class="text-center" style="color:red;">合计</td>
                        <td style="color:red;">@distribution</td>
                        <td style="color:red;">@recovery</td>
                        <td style="color:red;">@exchangegoods</td>
                        <td style="color:red;">@give</td>
                        @*<td style="color:red;">@backBox</td>*@
                        <td style="color:red;">@backNumber</td>
                        <td style="color:red;">@damage</td>
                        <td style="color:red;">@totalPrice</td>
                    </tr>
            }
        </tbody>
    </table>

</div>

<div style="margin-top:50px;">
    <table class="table table-bordered table-hover table-rowselected">
        <thead>
            <tr>
                <th colspan="6"><h3>应收统计</h3></th>
            </tr>
            <tr>
                <th>期初应收金额</th>
                <th>本期增加应收金额</th>
                <th>本期优惠金额</th>
                <th>本期使用预收款</th>
                <th>本期收款金额</th>
                <th>期末应收金额</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>@Model.ReceivableStatistics.InitialReceivableMoney</td>
                <td>@Model.ReceivableStatistics.PeriodIncreasedReceivableMoney</td>
                <td>@Model.ReceivableStatistics.PeriodPreferentialMoney</td>
                <td>@Model.ReceivableStatistics.PeriodUsePrepaymentsMoney</td>
                <td>@Model.ReceivableStatistics.PeriodReceiptMoney</td>
                <td>@Model.ReceivableStatistics.FinalReceivableMoney</td>
            </tr>
        </tbody>
    </table>
    <table class="table table-bordered table-hover table-rowselected">
        <thead>
            <tr>
                <th>期初预收款余额</th>
                <th>本期收回预收款</th>
                <th>本期核销预收款</th>
                <th>期末预收款余额</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>@Model.ReceivableStatistics.InitialPrepaymentsMoney</td>
                <td>@Model.ReceivableStatistics.PeriodRecyclingPrepaymentsMoney</td>
                <td>@Model.ReceivableStatistics.PeriodWriteOffPrepaymentsMoney</td>
                <td>@Model.ReceivableStatistics.FinalPrepaymentsMoney</td>
            </tr>
        </tbody>
    </table>
</div>

<div style="margin-top:50px;">
    <table class="table table-bordered table-hover table-rowselected">
        <thead>
            <tr>
                <th colspan="4"><h3>押金统计</h3></th>
            </tr>
            <tr>
                <th>期初押金余额</th>
                <th>本期收回押金</th>
                <th>本期退还押金</th>
                <th>期末押金余额</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>@Model.DepositStatistics.InitialDepositMoney</td>
                <td>@Model.DepositStatistics.PeriodRecyclingDepositMoney</td>
                <td>@Model.DepositStatistics.PeriodReturnDepositMoney</td>
                <td>@Model.DepositStatistics.FinalDepositMoney</td>
            </tr>
        </tbody>
    </table>
</div>